package priv.yiyuan.example.design.chain;

/**
 * SVIP会员折扣
 *
 * @author YiYuan
 * @data 2025/10/11
 * @apoNote
 */
public class SuperVipMemberDiscountStrategy implements DiscountStrategy {

    @Override
    public double calculateDiscount(Order order) {
        if (order.getMemberLevel() == 2) {
            double discountAmount = order.getOriginalPrice() * 0.15;
            order.addAppliedDiscountInfo("SVIP会员折扣(15%)");
            System.out.println("应用SVIP会员折扣: 优惠 " + String.format("%.2f", discountAmount) + "元。");
            return discountAmount;
        }

        return 0;
    }
}
